package main

import (
	"context"
	"github.com/micro/go-micro/v2"
	server "github.com/morphyguo/demo/srv/user/proto"
)

type userHandler struct {
}

func (u *userHandler) GetUserById(context context.Context, req *server.UserRequest, resp *server.UserResponse) error {
	resp.Id = req.Id
	resp.Name = "guolei"
	return nil
}

func main() {
	service := micro.NewService(micro.Name("go.micro.srv.user"), micro.Address(":8084"))
	service.Init()
	server.RegisterUserHandler(service.Server(), &userHandler{})

	service.Run()
}
